-- GENERATED SPELL FOR [Dragonflayer Metalworker] --


function spell0_24078(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_24078', 571, 1)
end

function spell1_24078(pUnit, Event) --@Sunder Armor,n/a--
pUnit:FullCastSpellOnTarget(59608,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24078', 30342, 1)
end

function spell2_24078(pUnit, Event) --@Sunder Armor,n/a--
pUnit:FullCastSpellOnTarget(15572,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24078', 30324, 1)
end

function Sorts_24078(pUnit, Event)
local choix_sorts_24078 = math.random(0, 2)
if choix_sorts_24078 == 0 then
pUnit:RegisterEvent('spell0_24078', 1, 1)
end
if choix_sorts_24078 == 1 then
pUnit:RegisterEvent('spell1_24078', 1, 1)
end
if choix_sorts_24078 == 2 then
pUnit:RegisterEvent('spell2_24078', 1, 1)
end
end

function mob24078_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24078', math.random(1500, 3000), 1)
end

function mob24078_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24078_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24078_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24078, 1, 'mob24078_Action')
RegisterUnitEvent(24078, 2, 'mob24078_Leave')
RegisterUnitEvent(24078, 3, 'mob24078_Kill')
RegisterUnitEvent(24078, 4, 'mob24078_Die')
